import java.util.Scanner;

/**
 * @Author YuanYuan
 * @Date 2022/4/29
 * @Time 14:57
 */
public class TestDemo {
    public static int sumEvery(int n) {
        if(0 == (n/10)) {
            return n;
        }else {
            return n%10 + sumEvery(n/10);
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(sumEvery(n));
    }
}
